VERSION 2.00
Begin Form frmOptions 
   BackColor       =   &H00C0C0C0&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "frmOptions"
   ClientHeight    =   3660
   ClientLeft      =   840
   ClientTop       =   1245
   ClientWidth     =   4455
   Height          =   4065
   Icon            =   OPTIONS.FRX:0000
   Left            =   780
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3660
   ScaleWidth      =   4455
   Top             =   900
   Width           =   4575
   Begin SSPanel pnlMain 
      AutoSize        =   3  'AutoSize Child To Panel
      BackColor       =   &H00C0C0C0&
      Font3D          =   0  'None
      ForeColor       =   &H00000000&
      Height          =   3660
      Left            =   0
      TabIndex        =   9
      Top             =   0
      Width           =   4455
      Begin CommandButton cmdOK 
         BackColor       =   &H00C0C0C0&
         Caption         =   "OK"
         Default         =   -1  'True
         Enabled         =   0   'False
         Height          =   330
         Left            =   3195
         TabIndex        =   7
         Top             =   300
         Width           =   1050
      End
      Begin CommandButton cmdCancel 
         BackColor       =   &H00C0C0C0&
         Cancel          =   -1  'True
         Caption         =   "Cancel"
         Height          =   330
         Left            =   3195
         TabIndex        =   8
         Top             =   705
         Width           =   1050
      End
      Begin SSFrame fraResource 
         Caption         =   "Update Work for"
         Font3D          =   0  'None
         Height          =   1410
         Left            =   180
         TabIndex        =   13
         Top             =   210
         Width           =   2805
         Begin SSOption optAllResources 
            Caption         =   "&All Resources"
            Font3D          =   0  'None
            Height          =   240
            Left            =   180
            TabIndex        =   0
            Top             =   315
            Value           =   -1  'True
            Width           =   1635
         End
         Begin SSOption optOneResource 
            Caption         =   "&One Resource"
            Font3D          =   0  'None
            Height          =   240
            Left            =   180
            TabIndex        =   1
            TabStop         =   0   'False
            Top             =   585
            Width           =   1635
         End
         Begin SSPanel pnlResources 
            AutoSize        =   3  'AutoSize Child To Panel
            BackColor       =   &H00C0C0C0&
            BevelOuter      =   1  'Inset
            Font3D          =   0  'None
            ForeColor       =   &H00000000&
            Height          =   330
            Left            =   165
            TabIndex        =   14
            Top             =   945
            Width           =   2520
            Begin ComboBox cboResources 
               Enabled         =   0   'False
               Height          =   300
               Left            =   15
               Style           =   2  'Dropdown List
               TabIndex        =   2
               Top             =   15
               Width           =   2490
            End
         End
      End
      Begin SSFrame fraDateRange 
         Caption         =   "Update Tasks within Date Range"
         Font3D          =   0  'None
         Height          =   1590
         Left            =   180
         TabIndex        =   10
         Top             =   1830
         Width           =   4065
         Begin SSPanel pnlFrom 
            AutoSize        =   3  'AutoSize Child To Panel
            BackColor       =   &H00C0C0C0&
            BevelOuter      =   1  'Inset
            Caption         =   "Panel3D1"
            Font3D          =   0  'None
            ForeColor       =   &H00000000&
            Height          =   335
            Left            =   315
            TabIndex        =   12
            Top             =   495
            Width           =   3110
            Begin TextBox txtFrom 
               Height          =   300
               Left            =   15
               TabIndex        =   4
               Top             =   15
               Width           =   3075
            End
         End
         Begin SSPanel pnlTo 
            AutoSize        =   3  'AutoSize Child To Panel
            BackColor       =   &H00C0C0C0&
            BevelOuter      =   1  'Inset
            Caption         =   "Panel3D2"
            Font3D          =   0  'None
            ForeColor       =   &H00000000&
            Height          =   335
            Left            =   315
            TabIndex        =   11
            Top             =   1125
            Width           =   3110
            Begin TextBox txtTo 
               Height          =   300
               Left            =   15
               TabIndex        =   6
               Top             =   15
               Width           =   3075
            End
         End
         Begin Label lblFrom 
            BackColor       =   &H00C0C0C0&
            Caption         =   "&From:"
            Height          =   240
            Left            =   315
            TabIndex        =   3
            Top             =   270
            Width           =   1455
         End
         Begin Label lblTo 
            BackColor       =   &H00C0C0C0&
            Caption         =   "&To:"
            Height          =   195
            Left            =   315
            TabIndex        =   5
            Top             =   900
            Width           =   1410
         End
      End
   End
End
Option Explicit      ' Require variable declaration.

Sub cmdCancel_Click ()

   TerminateApplication

End Sub

Sub cmdOK_Click ()

   Dim iResSelection As Integer, sFrom As String, sTo As String

   If optAllResources.Value = True Then
      iResSelection = ALL_RESOURCES
   ElseIf optOneResource.Value = True Then
      If cboResources.Enabled = True Then
         iResSelection = cboResources.ListIndex
      End If
   End If
   sFrom = txtFrom.Text
   sTo = txtTo.Text

   On Error GoTo cmdOk_ClickError

   SetParameters iResSelection, sFrom, sTo
   gbDTIF = False
   DisplayTInfoForm

   Exit Sub

cmdOk_ClickError:
   Select Case Err
      Case ERR_NO_RES_SELECTION
         Beep
         MsgBox MB_NO_RES_SELECTION, MB_ICONEXCLAMATION, MB_TIMESHEET
      Case ERR_FROMDATE
         Beep
         MsgBox MB_FROMDATE, MB_ICONEXCLAMATION, MB_TIMESHEET
         txtFrom.SelStart = 0
         txtFrom.SelLength = 32000
         txtFrom.SetFocus
      Case ERR_TODATE
         Beep
         MsgBox MB_TODATE, MB_ICONEXCLAMATION, MB_TIMESHEET
         txtTo.SelStart = 0
         txtTo.SelLength = 32000
         txtTo.SetFocus
      Case ERR_BAD_DATE_ORDER
         Beep
         MsgBox MB_BAD_DATE_ORDER, MB_ICONEXCLAMATION, MB_TIMESHEET
      Case ERR_BAD_DATE_RANGE
         Beep
         MsgBox MB_BAD_DATE_RANGE, MB_ICONEXCLAMATION, MB_TIMESHEET
      Case ERR_BAD_PARAM
         'In this case, we'll default to "all resources"
         iResSelection = ALL_RESOURCES
         Resume
      Case Else
         Beep
         MsgBox MB_GENERIC_ERROR + " Err#" + Str$(Err), MB_ICONEXCLAMATION, MB_TIMESHEET
         TerminateApplication
   End Select
   Exit Sub
End Sub

Sub Form_Load ()

' Size and position the main 3D panel.
pnlMain.Top = 0
pnlMain.Left = 0
pnlMain.Width = frmOptions.ScaleWidth
pnlMain.Height = frmOptions.ScaleHeight


' Center the form on the screen.
frmOptions.Top = (Screen.Height - frmOptions.Height) / 2
frmOptions.Left = (Screen.Width - frmOptions.Width) / 2

End Sub

Sub optAllResources_Click (Value As Integer)

   cboResources.ListIndex = -1
   cboResources.Enabled = False

End Sub

Sub optOneResource_Click (Value As Integer)
   
   If LoadResourceCombo(Me!cboResources) Then
      cboResources.Enabled = True

      ' Selects the first resource in the list, unless the user
      'has previously made a selection.
      If cboResources.ListIndex = -1 Then
         cboResources.ListIndex = 0
      End If

   End If

End Sub

Sub txtTo_Change ()

If Len(txtTo.Text) > 2 Then
   cmdOK.Enabled = True
Else
   cmdOK.Enabled = False
End If

End Sub

